<!--show and hide divs-->
<?php //var_dump(); die();?>
<script type="text/javascript">
	$(document).ready(function(e) {
		$("#school_details").click(function(){
			$(".upload_photos").show();
			$(".upload_photos2, .upload_photos3").hide();
			$(".form_fields1").show();
			$("#school_details").addClass('selected2');
			$("#college_details").removeClass('selected2');
			$("#PG_details").removeClass('selected2');
			$(".form_fields2").hide();
			$(".form_fields3").hide();
		});
		
		/**/
		$("#college_details").click(function(){
			<?php if($this->session->userdata('school_insert_id')==''){  ?>
				$("#join_as_form_school_detail").submit();
			<?php } ?>
			$(".form_fields2").show();
			$(".upload_photos2").show();
			$(".upload_photos, .upload_photos3").hide();
			$("#college_details").addClass('selected2');
			$("#school_details").removeClass('selected2');
			$("#PG_details").removeClass('selected2');
			$(".form_fields3").hide();
			$(".form_fields1").hide();
		});
		
		/**/
		$("#PG_details").click(function(){
			<?php if($this->session->userdata('school_insert_id')==''){  ?>
				$("#join_as_form_school_detail").submit();
			<?php } ?>
			$(".form_fields3").show();
			$(".upload_photos3").show();
			$(".upload_photos2, .upload_photos").hide();
			$("#PG_details").addClass('selected2');
			$("#college_details").removeClass('selected2');
			$("#school_details").removeClass('selected2');
			$(".form_fields1").hide();
			$(".form_fields2").hide();
		});
		
		/**/
		$(".select_school2").click(function(){
			$(".select_schoolform").show();
			$(".form_fields1").hide();
			$(".choices").hide();
		});
		
		$(".get_school_detail").click(function(){
			$(".select_schoolform").hide();
			$(".form_fields1").show();
			$(".choices").show();
		});
		
		/**/
		$(".select_class2").click(function(){
			$(".select_classform").show();
			$(".form_fields1").hide();
			$(".choices").hide();
		});
		
		$(".get_class_detail").click(function(){
			$(".select_classform").hide();
			$(".form_fields1").show();
			$(".choices").show();
		});
		
		/**/
		$(".state_form").click(function(){
			if($('#country').val()!=''){
				$(".select_stateform").show();
				$(".form_fields").hide();
				$(".choices").hide();
			}
			else {
				$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['state_counrty'])) echo $javscript_error['state_counrty']  ?>");
				$('#country_form').focus();
				return false;
			}
		});
		
		$(".state1_form").click(function(){
			if($('#country1').val()!=''){
				$(".select_stateform").show();
				$(".form_fields").hide();
				$(".choices").hide();
			}
			else {
				$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['state_counrty'])) echo $javscript_error['state_counrty']  ?>");
				$('#country1_form').focus();
				return false;
			}
		});
		
		$(".state2_form").click(function(){
			if($('#country2').val()!=''){
				$(".select_stateform").show();
				//$(".select_cityform").show();
				$(".form_fields").hide();
				$(".choices").hide();
			}else {
				$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['state_counrty'])) echo $javscript_error['state_counrty']  ?>");
				$('#country2_form').focus();
				return false;
			}
		});
		
		$(".get_state_detail").click(function(){
			$(".select_stateform").hide();
			$(".form_fields").show();
			$(".choices").show();
		});
		
		$(".country_form").click(function(){
			$(".select_countryform").show();
			$(".form_fields").hide();
			$(".choices").hide();
		});
		
		$(".get_country_detail").click(function(){
			$(".select_countryform").hide();
			$(".form_fields").show();
			$(".choices").show();
		});
		
		$(".country1_form").click(function(){
			$(".select_countryform").show();
			$(".form_fields").hide();
			$(".choices").hide();
		});
		
		$(".get_country_detail").click(function(){
			$(".select_countryform").hide();
			$(".form_fields").show();
			$(".choices").show();
		});
		
		$(".country2_form").click(function(){
			$(".select_countryform").show();
			$(".form_fields").hide();
			$(".choices").hide();
		});
		
		$(".get_country_detail").click(function(){
			$(".select_countryform").hide();
			$(".form_fields").show();
			$(".choices").show();
		});
		/**/
		$(".city_form").click(function(){
			if($('#state').val()!=''){
				$(".select_cityform").show();
				$(".form_fields").hide();
				$(".choices").hide();
			}else {
				$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['city_state'])) echo $javscript_error['city_state']  ?>");
				$('#country_form').focus();
				return false;
			}
		});
		
		$(".city1_form").click(function(){
			if($('#state1').val()!=''){				
				$(".select_cityform").show();
				$(".form_fields").hide();
				$(".choices").hide();
			}else {
				$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['city_state'])) echo $javscript_error['city_state']  ?>");
				$('#state1_form').focus();
				return false;
			}
		});
		
		$(".city2_form").click(function(){
			if($('#state2').val()!=''){				
				$(".select_cityform").show();
				$(".form_fields").hide();
				$(".choices").hide();
			}else {
				$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['city_state'])) echo $javscript_error['city_state']  ?>");
				$('#state2_form').focus();
				return false;
			}
		});
		
		$(".get_city_detail").click(function(){
			$(".select_cityform").hide();
			$(".form_fields").show();
			$(".choices").show();
		});
		
		/**/
		$(".college_name").click(function(){
			$(".select_collegeform").show();
			$(".form_fields2").hide();
			$(".choices").hide();
		});
		
		$(".get_college_detail").click(function(){
			$(".select_collegeform").hide();
			$(".form_fields2").show();
			$(".choices").show();
		});
		/**/
		$(".PG_name").click(function(){
			$(".select_PGform").show();
			$(".form_fields3").hide();
			$(".choices").hide();
		});
		
		$(".get_PG_detail").click(function(){
			$(".select_PGform").hide();
			$(".form_fields3").show();
			$(".choices").show();
		});
		
	});
</script>
<script type="text/javascript">
var allow = true;
var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
$(document).ready(function(){
  /*when member click on back button*/
  $(".go_back").click(function(){
    $(".select_stateform,.select_cityform,.select_countryform,.select_schoolform,.select_classform").hide();
	$(".form_fields,.form_fields1,.choices").show();
  });
  $(".go_back1").click(function(){
    $(".select_collegeform").hide();
	$(".form_fields2,.choices").show();
  });
  $(".go_back2").click(function(){
    $(".select_PGform").hide();
	$(".form_fields3,.choices").show();
  });
  $(".result_not_found").click(function(){
	   item_class=$(this).parent().find('input[type=text]').attr('id');
	   item_text=$(this).parent().find('input[type=text]').val();
	   item_text=item_text.trim();
	   $('.'+item_class+'_form').text(item_text);
    $(".select_stateform,.select_cityform,.select_countryform").hide();
	$(".form_fields").show();
  });
  
  $(".result_not_found1").click(function(){
	   item_class=$(this).parent().find('input[type=text]').attr('id');
	   item_text=$(this).parent().find('input[type=text]').val();
	   item_text=item_text.trim();
	   $('.'+item_class+'_name').text(item_text);
    $(".select_collegeform").hide();
	$(".form_fields2,.choices").show();
  });
  
  $(".result_not_found2").click(function(){
	   item_class=$(this).parent().find('input[type=text]').attr('id');
	   item_text=$(this).parent().find('input[type=text]').val();
	   item_text=item_text.trim();
	   $('.'+item_class+'_name').text(item_text);
    $(".select_PGform").hide();
	$(".form_fields3,.choices").show();
  });
  
  $("#first_name,#last_name,#email").keyup(function(){
   var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 { 
			$(".error_box").html("<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('');
	}
  });
  $("#email").focusout(function(){
  	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
		if($(this).val()=='')	
		{
			$(".error_box").html("<?php if(isset($javscript_error['email'])) echo $javscript_error['email']  ?>");
	        $(this).focus();
	        return false;
		}
		else if(check_letter.test($(this).val())==false)
		{
			$(".error_box").html("<?php if(isset($javscript_error['invalid_email'])) echo $javscript_error['invalid_email']  ?>");
			$(this).focus();
			return false;
		}
		else
		{
			$(".error_box").html('');
			checkEmail($(this).val());
			//$(this).focus();
		}
		
  });
  $("#password").keyup(function()
  {
		$('.error_box').html(checkStrength($(this).val()));
  });
  $("#password").focusout(function(){
		$('.error_box').html('');
		if($(this).val()=='')	
		{
			$(".error_box").html("<?php if(isset($javscript_error['password'])) echo $javscript_error['password']  ?>");
	        $(this).focus();
	        return false;
		}
  });	
  
  $("#phone_number1").keyup(function(){
	  check_letter2=/[0-9]/i;
		if($(this).val()!='')
		{
		   if(check_letter2.test($(this).val())==false)
			{
			  $(".error_box").show();
			  $(".error_box").html("<?php if(isset($javscript_error['invalid_phone'])) echo $javscript_error['invalid_phone']  ?>");
			  $(this).focus();
			  return false;
			}	
		}
   });
   
   $("#section,#roll_no,#admission_no,#class_teacher,#my_fav_teacher,#highlights,#highlight2,#highlight3,#memories,#course_name,#associations,#achievements,#internships,#supw,#recommendations,#current_employer,#designation,#profile_description,#period,#from_date,#till_date,#previous_employer,#designation1,#profile_description1,#period1,#from_date1,#till_date1,#my_hobbies,#books_that_i_have_read,#movies_that_i_have_seen,#my_associations,#my_blogs,#my_websites").keyup(function(){
   		var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
   		$(".error_box").html('');
		if($(this).val()!='')
		{
	   		if(check_letter.test($(this).val())==false)
	   		{
	   			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
				$(this).focus();
				return false;
	   		}
	   		else
			 {
				$(".error_box").html('');
			 }
		}
		else
		{
			$(".error_box").html('');
		}
   });
   
   $("#section,#roll_no,#admission_no,#class_teacher,#my_fav_teacher,#highlights,#highlight2,#highlight3,#memories,#course_name,#associations,#achievements,#internships,#supw,#recommendations,#current_employer,#designation,#profile_description,#period,#from_date,#till_date,#previous_employer,#designation1,#profile_description1,#period1,#from_date1,#till_date1,#my_hobbies,#books_that_i_have_read,#movies_that_i_have_seen,#my_associations,#my_blogs,#my_websites").focusout(function(){
   		var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
   		$(".error_box").html('');
		if($(this).val()!='')
		{
	   		if(check_letter.test($(this).val())==false)
	   		{
	   			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
				$(this).focus();
				return false;
	   		}
	   		else
			 {
				$(".error_box").html('');
			 }
		}
		else
		{
			$(".error_box").html('');
		}
   });
   
   $("#state").keyup(function(){
   	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 {
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadData_state($(this).val(),'state',$('#country').val());
  });
  
  $("#city").keyup(function(){
  	var allow = true;
  	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 {
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadData_city($(this).val(),'city',$('#state').val());
  });
  
  $("#country").keyup(function(){
	  
   	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 {
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadData($(this).val(),'country');
  });
  
  $("#country1").keyup(function(){
   	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 {
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadData($(this).val(),'country1');
  });
  
  $("#country2").keyup(function(){
   	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 {
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadData($(this).val(),'country2');
  });
  	
$("#state1").keyup(function(){
	//alert($(this).val());
   	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 {
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadData_state($(this).val(),'state1',$('#country1').val());
  });
  
  $("#city1").keyup(function(){
  	var allow = true;
  	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 {
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadData_city($(this).val(),'city1',$('#state1').val());
  });
  
  $("#state2").keyup(function(){
	//alert('test');
	//alert($(this).val());
   	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 {
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadData_state($(this).val(),'state2',$('#country2').val());
  });
  
  $("#city2").keyup(function(){
  	var allow = true;
  	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 {
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadData_city($(this).val(),'city2',$('#state2').val());
  });
  
  $("#school").keyup(function(){
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 { 
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadData($(this).val(),'school');
  });
  
  $("#college").keyup(function(){
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 { 
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadCollege($(this).val(),'college');
  });
  
  $("#PG").keyup(function(){
  	$(".error_box").html('');
	if($(this).val()!='')
	{
		 if(check_letter.test($(this).val())==false)
		 { 
			$(".error_box").html('<samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>");
			$(this).focus();
			return false;
		  }
		 else
		 {
			$(".error_box").html('');
		 }
	}
	else
	{
		$(".error_box").html('')
	}
	loadpg($(this).val(),'PG');
  });
  
  $(".join_as_detail_class").click(function(){
	 html_item=$(this).html();
	 class_id=$(this).attr('id');
	 class_name=html_item.match(/\d+/)[0];
	 $("#class").val(class_id);
	 $(".select_class2").text(class_name);
    $(".select_classform").hide();
    $(".form_fields1").show();
	$(".choices").show();
  });
 
	/*--------when member submit form-------------------*/
 	 $("#personal_detail").click(function()
	  {
		var email_exp = /\S+@\S+\.\S+/;
		var date_exp=/^\d\d\d\d$/;
		var num_exp = /^[0-9- ]+$/;
	    email=$("#email");
		password=$("#password");
	    first_name=$("#first_name");
		tagline=$("#tagline");
		postal_code=$("#postal_code");
		city=$("#city");
		state=$("#state");
		phone_number1=$("#phone_number1");;
		if(email.val()==''||email.val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['email'])) echo $javscript_error['email']  ?>"+'</div>');
			email.focus();
			return false;
		}
		else if(email_exp.test(email.val())==false)
		{ 
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['invalid_email'])) echo $javscript_error['invalid_email']  ?>"+'</div>');
			email.focus();
			return false;
		}
		else if(password.val()=='')
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['password'])) echo $javscript_error['password']  ?>"+'</div>');
			password.focus();
			return false;
		}
		else if(first_name.val().trim()==""||first_name.val()=='First Name')
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['first_name'])) echo $javscript_error['first_name']  ?>"+'</div>');
			first_name.focus();
			return false;
		}
		else if(postal_code.val()!=''){
			if(num_exp.test(dob.postal_code())==false)
			{
				$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>"+'</div>');
				postal_code.focus();
				return false;
			}
		}
		else
		{
			$("#join_as_form_institution_detail").submit();
		}
	  });
	  
	  /////////////////------------->
	  	$("#personal_detail2").click(function()
	  {
		//  alert(); 
		 $("#join_as_form_institution_detail2").submit();
		 
	  });
	  $("#personal_detail3").click(function()
	  {
		 $("#join_as_form_institution_detail3").submit();
		 
	  });
	  
	  /////////////////------------->
	  
	  $("#academic_detail_college,#add_more_college").click(function()
	  {
	  	var check_letter=/^([0-9]|[a-z])+([0-9a-z]+)$/i;
	    college=$("#college");
		course_name=$("#course_name");
		
		if(college.val()==''||college.val()==null)
		{
			$(".error_box").html('<div class="error"><samp>*</samp>'+"<?php if(isset($javscript_error['college'])) echo $javscript_error['college']  ?>"+'</div>');
			return false;
		}
		else if(course_name.val().trim()==""||course_name.val()=='First Name')
		{
			$(".error_box").html('<div class="error"><samp>*</samp>'+"<?php if(isset($javscript_error['required'])) echo $javscript_error['required']  ?>"+'</div>');
			course_name.focus();
			return false;
		}
		else if(check_letter.test(course_name.val())==false)
		{ 
			$(".error_box").html('<div class="error"><samp>*</samp>'+"<?php if(isset($javscript_error['invalid_input'])) echo $javscript_error['invalid_input']  ?>"+'</div>');
			course_name.focus();
			return false;
		}
		else
		{
			$("#join_as_form_college_detail").submit();
		}
	  });
	  
	  $(".prev,.next").click(function(){
	  	if($("#school").val()!='')
	  	{
	  		$("year").val($("#range").val());
	  		$("#join_as_form_school_detail").submit();
	  	}
	  	if($("#college").val()!='')
	  	{
	  		$("year1").val($("#range").val());
	  		$("#join_as_form_college_detail").submit();	
	  	}
	  	if($("#PG").val()!='')
	  	{
	  		$("year2").val($("#range").val());
	  		$("#join_as_form_pg_detail").submit();
	  	}
	  });
	  
	  $("#academic_detail_pg,#add_more_pg").click(function()
	  {
	    college=$("#PG");
		
		if(college.val()==''||college.val()==null)
		{
			$(".error_box").html('<div class="error"><samp>*</samp>'+"<?php if(isset($javscript_error['college'])) echo $javscript_error['college']  ?>"+'</div>');
			return false;
		}
		else
		{
			$("#join_as_form_pg_detail").submit();
		}
	  });
	  
	  $("#academic_detail_prof,#add_more_prof").click(function()
	  {
	    emp=$("#current_employer");
		
		if(emp.val()==''||emp.val()==null)
		{
			$(".error_box").html('<div class="error"><samp>*</samp>'+"<?php if(isset($javscript_error['current_employer'])) echo $javscript_error['current_employer']  ?>"+'</div>');
			emp.focus();
			return false;
		}
		else
		{
			$("#join_as_form_professional_detail").submit();
		}
	  });
	  
	  $("#interest_detail").click(function()
	  {
	    hob=$("#my_hobbies");
		
		if(hob.val()==''||hob.val()==null)
		{
			$(".error_box").html('<div class="error"><samp>*</samp>'+"<?php if(isset($javscript_error['required'])) echo $javscript_error['required']  ?>"+'</div>');
			hob.focus();
			return false;
		}
		else
		{
			$("#join_as_form_interest_detail").submit();
		}
	  });
	  
	  $("#academic_detail_school,#add_more").click(function(){
	  	var check_letter=/^\s*[a-zA-Z0-9_.@\-\s]+\s*$/;
	  	if($("#school").val()==''||$("#school").val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['school'])) echo $javscript_error['school']  ?>"+'</div>');
			$("#school").focus();
			return false;
		}
		else if($("#class").val()==''||$("#class").val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['class_name'])) echo $javscript_error['class_name']  ?>"+'</div>');
			$("#class").focus();
			return false;
		}
		else if($("#section").val()==''||$("#section").val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['section'])) echo $javscript_error['section']  ?>"+'</div>');
			$("#section").focus();
			return false;
		}
		else if($("#roll_no").val()==''||$("#roll_no").val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['required'])) echo $javscript_error['required']  ?>"+'</div>');
			$("#roll_no").focus();
			return false;
		}
		else if($("#admission_no").val()==''||$("#admission_no").val()==null)
		{
			$(".error_box").html('<div class="error"><samp>*</samp>'+"<?php if(isset($javscript_error['required'])) echo $javscript_error['required']  ?>"+'</div>');
			$("#admission_no").focus();
			return false;
		}
		else if($("#class_teacher").val()==''||$("#class_teacher").val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['required'])) echo $javscript_error['required']  ?>"+'</div>');
			$("#class_teacher").focus();
			return false;
		}
		else if($("#my_fav_teacher").val()==''||$("#my_fav_teacher").val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['required'])) echo $javscript_error['required']  ?>"+'</div>');
			$("#my_fav_teacher").focus();
			return false;
		}
		else if($("#highlights").val()==''||$("#highlights").val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['required'])) echo $javscript_error['required']  ?>"+'</div>');
			$("#highlights").focus();
			return false;
		}
		else if($("#highlight2").val()==''||$("#highlight2").val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['required'])) echo $javscript_error['required']  ?>"+'</div>');
			$("#highlight2").focus();
			return false;
		}
		else if($("#highlight3").val()==''||$("#highlight3").val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['required'])) echo $javscript_error['required']  ?>"+'</div>');
			$("#highlight3").focus();
			return false;
		}
		else if($("#memories").val()==''||$("#memories").val()==null)
		{
			$(".error_box").html('<div class=""><samp>*</samp>'+"<?php if(isset($javscript_error['required'])) echo $javscript_error['required']  ?>"+'</div>');
			$("#memories").focus();
			return false;
		}
		else 
		{
			$("#join_as_form_school_detail").submit();
		}
	  });

function checkEmail(q)
	{
		if(allow)
		{
			allow = false;
			$.ajax({
				url:'<?php echo base_url() ?>'+'index.php/check_mail',
	            type : 'POST',
	            data : {'search' : q},
				success: function (data)
				{
				   if(data=='success')
				   {
						$('.error_box').html('');
						allow = false;
						return allow;
				   }
				   else
				   {
					    $('.error_box').html(data);
					    $("#email").focus();
					    allow = true;
					    return allow;
				   }
				  allow = true;
				}
			});
		}
	}
	
	function checkStrength(password)
	{
		//initial strength
		var strength = 0
		if (password.length == 0) { 
			$('.error_box').html();
			return false; 
		}
		//if the password length is less than 5, return message.
		if (password.length > 0 && password.length < 5) { 
			$('.error_box').html("short");
			return 'Too short' 
		}
		//if length is 8 characters or more, increase strength value
		if (password.length > 7) strength += 1
		//if password contains both lower and uppercase characters, increase strength value
		if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))  strength += 1
		//if it has numbers and characters, increase strength value
		if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/))  strength += 1 
		//if it has one special character, increase strength value
		if (password.match(/([!,%,&,@,#,$,^,*,?,_,~])/))  strength += 1
		//if it has two special characters, increase strength value
		if (password.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1
		//now we have calculated strength value, we can return messages
		//if value is less than 2
		if (strength < 2 )
		{
			$('.error_box').html("weak");
			return 'Weak'			
		}
		else if (strength == 2 )
		{
			$('.error_box').html("good");
			return 'Good'		
		}
		else
		{
			$('.error_box').html("strong");
			return 'Strong'
		}
	}
	
function loadData(q,key_id)
{
	$("#"+key_id+"_result").html('loading...');
	$.ajax({
		url:'<?php echo base_url() ?>'+'index.php/live/'+key_id,
        type : 'POST',
        data : {'search' : q},
		success: function (data){
			//alert(data);
			$("#"+key_id+"_result").html(data);
			$("#"+key_id+"_result").find(".join_as_detail_"+key_id).click(function()
			{
				//alert();
				obj_name=$(this).html();
				obj_id=$(this).attr('id');
				$("#"+key_id+"_1").val(obj_name);
				//alert($("#"+key_id+"_1").val(obj_name));
				if(obj_name.length > 10){
					$("."+key_id+"_form").text(obj_name.substring(0,10)+'....');
				}else {
					$("."+key_id+"_form").text(obj_name);
				}
				$(".select_"+key_id+"2").text(obj_name);
				$("#"+key_id).val(obj_id);
				$(".select_"+key_id+"form").hide();
				$(".form_fields,.form_fields1,.choices").show();
			});
			if(data=='No record found. Click on the submit button.')
		   {
			$('.result_not_found').show();
		   }
           else
		   {
			   $('.result_not_found').hide();
		   }
		}
	});
	}

	function loadData_state(q,key_id,c_id)
	{
	$("#"+key_id+"_result").html('loading...');
	$.ajax({
		url:'<?php echo base_url() ?>'+'index.php/live/'+key_id,
        type : 'POST',
        data : {'search' : q, 'country' : c_id },
		success: function (data){
			//alert(data);
			$("#"+key_id+"_result").html(data);
			$("#"+key_id+"_result").find(".join_as_detail_"+key_id).click(function()
			{
				obj_name=$(this).html();
				obj_id=$(this).attr('id');
				$("#"+key_id+"_1").val(obj_name);
				//alert($("#"+key_id+"_1").val(obj_name));
				if(obj_name.length > 10){
					$("."+key_id+"_form").text(obj_name.substring(0,10)+'....');
				}else {
					$("."+key_id+"_form").text(obj_name);
				}
				$(".select_"+key_id+"2").text(obj_name);
				$("#"+key_id).val(obj_id);
				$(".select_"+key_id+"form").hide();
				$(".form_fields,.form_fields1,.choices").show();
			});
			if(data=='No record found. Click on the submit button.')
		   {
			$('.result_not_found').show();
		   }
           else
		   {
			   $('.result_not_found').hide();
		   }
		}
	});
	}
	
	function loadData_city(q,key_id,s_id)
	{
	$("#"+key_id+"_result").html('loading...');
	$.ajax({
		url:'<?php echo base_url() ?>'+'index.php/live/'+key_id,
        type : 'POST',
        data : {'search' : q, 'state' : s_id },
		success: function (data){
			//alert(data);
			$("#"+key_id+"_result").html(data);
			$("#"+key_id+"_result").find(".join_as_detail_"+key_id).click(function()
			{
				//alert();
				obj_name=$(this).html();
				obj_id=$(this).attr('id');
				$("#"+key_id+"_1").val(obj_name);
				//alert($("#"+key_id+"_1").val(obj_name));
				if(obj_name.length > 10){
					$("."+key_id+"_form").text(obj_name.substring(0,10)+'....');
				}else {
					$("."+key_id+"_form").text(obj_name);
				}
				$(".select_"+key_id+"2").text(obj_name);
				$("#"+key_id).val(obj_id);
				$(".select_"+key_id+"form").hide();
				$(".form_fields,.form_fields1,.choices").show();
			});
			if(data=='No record found. Click on the submit button.')
		   {
			$('.result_not_found').show();
		   }
           else
		   {
			   $('.result_not_found').hide();
		   }
		}
	});
	}

		
	function loadCollege(q,key_id)
	{
	$("#"+key_id+"_result").html('loading...');
	$.ajax({
		url:'<?php echo base_url() ?>'+'index.php/live/'+key_id,
        type : 'POST',
        data : {'search' : q},
		success: function (data){
			$("#"+key_id+"_result").html(data);
			$("#"+key_id+"_result").find(".join_as_detail_institute").click(function()
			{
				obj_name=$(this).html();
				obj_id=$(this).attr('id');
				$("#"+key_id+"_1").val(obj_name);
				if(obj_name.length > 10){
					$("."+key_id+"_name").text(obj_name.substring(0,10)+'....');
				}else {
					$("."+key_id+"_name").text(obj_name);
				}
				$("#"+key_id).val(obj_id);
				$(".select_"+key_id+"form").hide();
				$(".form_fields2,.choices").show();
			});
			if(data=='No record found. Click on the submit button.')
		   {
			$('.result_not_found1').show();
		   }
           else
		   {
			   $('.result_not_found1').hide();
		   }
		}
	});
	}
	
	function loadpg(q,key_id)
	{
	$("#"+key_id+"_result").html('loading...');
	$.ajax({
		url:'<?php echo base_url() ?>'+'index.php/live/'+key_id,
        type : 'POST',
        data : {'search' : q},
		success: function (data){
			$("#"+key_id+"_result").html(data);
			$("#"+key_id+"_result").find(".join_as_detail_institute").click(function()
			{
				obj_name=$(this).html();
				obj_id=$(this).attr('id');
				$("#"+key_id+"_1").val(obj_name);
				if(obj_name.length > 10){
					$("."+key_id+"_name").text(obj_name.substring(0,10)+'....');
				}else {
					$("."+key_id+"_name").text(obj_name);
				}
				$("#"+key_id).val(obj_id);
				$(".select_"+key_id+"form").hide();
				$(".form_fields3,.choices").show();
			});
			if(data=='No record found. Click on the submit button.')
		   {
			$('.result_not_found2').show();
		   }
           else
		   {
			   $('.result_not_found2').hide();
		   }
		}
	});
	}
});
</script>
<script>
	$(document).ready(function(e) {
		$("#personal").addClass("active");
		$(".personal_image1").hide();
		$(".personal_image2").hide();
		$(".personal_image").show();
		<?php 
			if(isset($next) && $next == 'academic_college'){?>
				$("#college_details").click(function(){
				$(".form_fields2").show();
				$(".upload_photos2").show();
				$(".upload_photos, .upload_photos3").hide();
				$("#college_details").addClass('selected2');
				$("#school_details").removeClass('selected2');
				$("#PG_details").removeClass('selected2');
				$(".form_fields3").hide();
				$(".form_fields1").hide();
				});
		<?php } ?>
		<?php if(isset($next) && $next == 'personal'){?>
			$(".personal_details").show();
				$(".personal_image").show();
				$("#personal").addClass("active");
				$("#professional").removeClass("active");
				$("#academic").removeClass("active");
				$("#myinterest").removeClass("active");
				$(".academic_details").hide();
				$(".professional_details").hide();
				$(".myinterest").hide();
				$(".professional_image, .academic_image, .upload_photos,  .upload_photos2,  .upload_photos3").hide();
		<?php } if(isset($current_div) && $current_div == 'bussiness_entity'){?>
			$(".professional_details").css('display','block');
				$(".professional_image").show();
				$("#professional").addClass("active");
				$("#personal").removeClass("active");
				$("#academic").removeClass("active");
				$("#myinterest").removeClass("active");
				$(".academic_details").hide();
				$(".personal_details").hide();
				$(".myinterest").hide();
				$(".personal_image, .upload_photos, .academic_image,  .upload_photos2,  .upload_photos3").hide();
		<?php } 
		if(isset($current_div) && $current_div == 'college'){?>
			$(".academic_details, .upload_photos").show();
				$(".academic_image").show();
				$("#academic").addClass("active");
				$("#professional").removeClass("active");
				$("#personal").removeClass("active");
				$("#myinterest").removeClass("active");
				$(".personal_details").hide();
				$(".professional_details").hide();
				$(".myinterest").hide();
				$(".personal_image, .professional_image,  .upload_photos2,  .upload_photos3").hide();
		<?php } if(isset($next) && $next == 'myinterest'){?>
			$(".myinterest").show();
				$("#myinterest").addClass("active");
				$("#professional").removeClass("active");
				$("#academic").removeClass("active");
				$("#personal").removeClass("active");
				$(".academic_details").hide();
				$(".professional_details").hide();
				$(".personal_details, .upload_photos,  .upload_photos2,  .upload_photos3").hide();
		<?php }?>
        $("#personal").click( function(){
				$(".personal_details").show();
				$(".personal_image").show();
				$("#personal").addClass("active");
				$("#professional").removeClass("active");
				$("#academic").removeClass("active");
				$("#myinterest").removeClass("active");
				$(".academic_details").hide();
				$(".professional_details").hide();
				$(".myinterest").hide();
				$(".professional_image,.personal_image1,.personal_image2, .academic_image, .upload_photos,  .upload_photos2,  .upload_photos3").hide();
			});
			
			$("#professional").click( function(){
			//	alert('test');
					$(".professional_details").show();
					$(".professional_image").show();
					$("#professional").addClass("active");
					$("#personal").removeClass("active");
					$("#academic").removeClass("active");
					$("#myinterest").removeClass("active");
					$(".academic_details").hide();
					$(".personal_details").hide();
					$(".myinterest").hide();
					$(".personal_image1").show();
					$(".personal_image,.personal_image2, .upload_photos, .academic_image,  .upload_photos2,  .upload_photos3").hide();
			});
			
			$("#academic").click( function(){
				
				<?php //if(isset($next) && ($next == 'academic' || $next == 'professional' || $next == 'myinterest')){?>
					$(".academic_details, .upload_photos").show();
					$(".academic_image").show();
					$("#academic").addClass("active");
					$("#professional").removeClass("active");
					$("#personal").removeClass("active");
					$("#myinterest").removeClass("active");
					$(".personal_details").hide();
					$(".professional_details").hide();
					$(".myinterest").hide();
					$(".personal_image2").show();
					$(".personal_image,.personal_image1, .professional_image,  .upload_photos2,  .upload_photos3").hide();
				<?php //}else{?>
					/*if($("#email").val() == '' || $("#password") == '')
					{
						$(this).focus();
						return false;
					}*/
					/*else
					{ 
						<?php //if($this->session->userdata('insert_id')==''){ ?>
							$("#join_as_form_detail").submit();
						<?php //} ?>
						$(".academic_details, .upload_photos").show();
						$(".academic_image").show();
						$("#academic").addClass("active");
						$("#professional").removeClass("active");
						$("#personal").removeClass("active");
						$("#myinterest").removeClass("active");
						$(".personal_details").hide();
						$(".professional_details").hide();
						$(".myinterest").hide();
						$(".personal_image, .professional_image,  .upload_photos2,  .upload_photos3").hide();
					}*/
				<?php //}?>
			});
			
			$("#myinterest").click( function(){
				<?php if(isset($next) && $next == 'myinterest'){?>
					$(".myinterest").show();
					$("#myinterest").addClass("active");
					$("#professional").removeClass("active");
					$("#academic").removeClass("active");
					$("#personal").removeClass("active");
					$(".academic_details").hide();
					$(".professional_details").hide();
					$(".personal_details, .upload_photos,  .upload_photos2,  .upload_photos3").hide();
				<?php }else{?>
					if($("#email").val() == '' || $("#password") == '')
					{
						$(this).focus();
						return false;
					}
					else
					{
						<?php if($this->session->userdata('insert_id')==''){ ?>
							$("#join_as_form_detail").submit();
						<?php } ?>
						$(".myinterest").show();
						$("#myinterest").addClass("active");
						$("#professional").removeClass("active");
						$("#academic").removeClass("active");
						$("#personal").removeClass("active");
						$(".academic_details").hide();
						$(".professional_details").hide();
						$(".personal_details, .upload_photos,  .upload_photos2,  .upload_photos3").hide();
					}
				<?php }?>
			});
	});
			
</script>
<style>
      #description {
        height:96%;
        width: 46.5%;
        overflow: hidden;
        position: absolute;
      }
	  #description1 {
        height:480px;
        width: 46.5%;
        overflow: hidden;
        position: absolute;
      }
	  #description2 {
        height:480px;
        width: 46.5%;
        overflow: hidden;
        position: absolute;
      }
	  #description3 {
        height:480px;
        width: 46.5%;
        overflow: hidden;
        position: absolute;
      }
</style>
<script type="text/javascript">
      $(document).ready(function ($) {
        $('#description, #description1, #description2, #description3').perfectScrollbar({
          wheelSpeed: 40,
          wheelPropagation: false
        });
	});
    </script>
<script type="text/javascript">
$(document).ready(function ($) {
	$(".upload_file_data").click(function(){
	   alias= $(this).attr('title');	   
	   if(alias!='')
	   {
	     fileSelector = $('input[name=upload_'+alias+'_photo_file]')
	     fileSelector.click();
	     return false;
	   }
	});
});

function FileUploadStart(obj)
{
	var $form=$('#'+'upload_'+obj+'_photo_form');
	$form.attr('action','./fileupload');
	$form.attr('target','upload_iframe');
	$form.attr('method','post');
	$form.attr('enctype','multipart/form-data');
	$form.submit();
	$('#upload_'+obj+'_photo_response').html('loading...');
	$('#upload_iframe').on('load',function()
	{
		$('#upload_'+obj+'_photo_response').html($(this).contents().find('html').html());
		$form.removeAttr('action');
		$form.removeAttr('target');
		$form.removeAttr('method');
		$form.removeAttr('enctype');
    })
	return false;
}
</script>

<script>
		$(function(){
			$('#slides').slides({
				preload: true,
				preloadImage: 'images/loading.gif',
				play: false,
				hoverPause: false
			});
			$('#slides2').slides({
				preload: true,
				preloadImage: 'images/loading.gif',
				play: false,
				hoverPause: false
			});
		});
</script>
